<?php

namespace common\models\cms;

use Yii;

/**
 * This is the model class for table "{{%cms_article_default}}".
 *
 * @property int $id
 * @property int $article_id 文章ID
 * @property string|null $body 文章图文详情
 * @property int $created_at
 * @property int $updated_at
 */
class CmsArticleDefault extends \common\db\ActiveRecord {

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%cms_article_default}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['article_id', 'created_at', 'updated_at'], 'integer'],
            [['body'], 'string'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'article_id' => '文章ID',
            'body' => '文章图文详情',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }

    /**
     * 关联文章详情
     */
    public function getArticle() {
        return $this->hasOne(CmsArticle::class, ['id' => 'article_id']);
    }

}
